/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "adm_division_politica")
@NamedQueries({
    @NamedQuery(name = "AdmDivisionPolitica.findAll", query = "SELECT a FROM AdmDivisionPolitica a")})
public class AdmDivisionPolitica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_division")
    private Integer idDivision;
    @Basic(optional = false)
    @Column(name = "codigo")
    private String codigo;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "urbano")
    private Integer urbano;
    @Column(name = "cod")
    private String cod;
    @OneToMany(mappedBy = "admDivisionPolitica", fetch = FetchType.LAZY)
    private List<AdmDivisionPolitica> admDivisionPoliticaList;
    @JoinColumn(name = "adm_id_division", referencedColumnName = "id_division")
    @ManyToOne(fetch = FetchType.LAZY)
    private AdmDivisionPolitica admDivisionPolitica;
    @OneToMany(mappedBy = "admDivisionPolitica", fetch = FetchType.LAZY)
    private List<AdmInstitucion> admInstitucionList;
    @OneToMany(mappedBy = "admDivisionPolitica", fetch = FetchType.LAZY)
    private List<CexHistoriaClinica> cexHistoriaClinicaList;

    public AdmDivisionPolitica() {
    }

    public AdmDivisionPolitica(Integer idDivision) {
        this.idDivision = idDivision;
    }

    public AdmDivisionPolitica(Integer idDivision, String codigo, String nombre) {
        this.idDivision = idDivision;
        this.codigo = codigo;
        this.nombre = nombre;
    }

    public Integer getIdDivision() {
        return idDivision;
    }

    public void setIdDivision(Integer idDivision) {
        this.idDivision = idDivision;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Integer getUrbano() {
        return urbano;
    }

    public void setUrbano(Integer urbano) {
        this.urbano = urbano;
    }

    public String getCod() {
        return cod;
    }

    public void setCod(String cod) {
        this.cod = cod;
    }

    public List<AdmDivisionPolitica> getAdmDivisionPoliticaList() {
        return admDivisionPoliticaList;
    }

    public void setAdmDivisionPoliticaList(List<AdmDivisionPolitica> admDivisionPoliticaList) {
        this.admDivisionPoliticaList = admDivisionPoliticaList;
    }

    public AdmDivisionPolitica getAdmDivisionPolitica() {
        return admDivisionPolitica;
    }

    public void setAdmDivisionPolitica(AdmDivisionPolitica admDivisionPolitica) {
        this.admDivisionPolitica = admDivisionPolitica;
    }

    public List<AdmInstitucion> getAdmInstitucionList() {
        return admInstitucionList;
    }

    public void setAdmInstitucionList(List<AdmInstitucion> admInstitucionList) {
        this.admInstitucionList = admInstitucionList;
    }

    public List<CexHistoriaClinica> getCexHistoriaClinicaList() {
        return cexHistoriaClinicaList;
    }

    public void setCexHistoriaClinicaList(List<CexHistoriaClinica> cexHistoriaClinicaList) {
        this.cexHistoriaClinicaList = cexHistoriaClinicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDivision != null ? idDivision.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdmDivisionPolitica)) {
            return false;
        }
        AdmDivisionPolitica other = (AdmDivisionPolitica) object;
        if ((this.idDivision == null && other.idDivision != null) || (this.idDivision != null && !this.idDivision.equals(other.idDivision))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.AdmDivisionPolitica[ idDivision=" + idDivision + " ]";
    }
    
}
